package CSV;

import java.util.Comparator;
import java.util.Map;

public class MyComparatorDouble implements Comparator<Object>{

	@SuppressWarnings("unchecked")
	public int compare(Object obj1, Object obj2){
		int result=0;
		Map.Entry e1 = (Map.Entry)obj1 ;
		Map.Entry e2 = (Map.Entry)obj2 ;
		//Sort based on values.

		Double value1 = (Double)e1.getValue();
		Double value2 = (Double)e2.getValue();


		//Sort values in a descending order
		result=value2.compareTo( value1 );
		return result;
	}
}

